package org.cytoscape.myapp.cytoscape_app_v1.internal.grupos.aggregation;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.myapp.cytoscape_app_v1.internal.helpers.ColumnListEnum;

public class AggregationListString  extends AggregationList{


	public AggregationListString(CyNetwork cyNetwork) {
		super(cyNetwork);
	}

	public Object getAggregation(String columnName,
			List<CyNode> nodesToAggregate) {
		
		Set<String> values = new  HashSet<String>();
		for (CyNode cyNode : nodesToAggregate) {
			List<String> valuesNode = this.cyNetwork.getDefaultNodeTable()
						.getRow(cyNode.getSUID())
						.getList(columnName, String.class);
			
			values.addAll(valuesNode);
		}
		
		return new ArrayList(values);
	}

	
}
